<?php
include ("./src/jpgraph.php");
include ("./src/jpgraph_bar.php");
$n = 27;
	for($i=0; $i < $n; ++$i ) {
	    $tmp =$phylum_arr[$i][0];
	    $targ1[$i] = "http://www.fossilplot.org/test/new/v9/graph/getgenera.php?arg1=$tmp&arg2=$period";	    
	    $alts1[$i] = "number of genera=%d";   
	}


$datay=array(48,0,270,34,0,80,0,0,0,0,0,1,0,6,0,0,1302,0,253,152,0,48,0,136,0,0,507);
$datax=array("Ph. ACTINOPODA","Ph. CILIOPHORA","Ph. RHIZOPODEA","Ph. PORIFERA","Ph. TRILOBOZOA","Ph. CNIDARIA","Ph. CTENOPHORA","Ph. NEMATODA","Ph. NEMERTINA","Ph. PRIAPULIDA","Ph. ECHIURIDA","Ph. POGONOPHORA","Ph. PENTASTOMIDA","Ph. ANNELIDA","Ph. PROBLEMATICA","Ph. HYOLITHA","Ph. MOLLUSCA","Ph. LOBOPODA","Ph. ARTHROPODA","Ph. BRYOZOA","Ph. ENTOPROCTA","Ph. BRACHIOPODA","Ph. CHAETOGNATHA","Ph. ECHINODERMATA","Ph. HEMICHORDATA","Ph. CHORDATA","Ph. EUCHORDATA");

//$datay=array(12,8,19,3,10,5);
//$datax=array("ph1","ph2","ph3","ph4","ph5","ph6");

$graph = new Graph(1000,650,"auto");    
$graph->SetScale("textlin");
$graph->SetShadow();
$graph->img->SetMargin(40,30,20,130);
$bplot = new BarPlot($datay);

$bplot->SetFillColor('green');
$bplot->value->SetFormat('%d');

$bplot->value->Show();
$graph->Add($bplot);

$graph->title->Set("Neogene period graph");
$graph->xaxis->title->Set("Phylum Names");
$graph->yaxis->title->Set("Number of Genera");
$graph->xaxis->SetTickLabels($datax);
$graph->xaxis->SetLabelAngle(90);
$graph->xaxis->title->SetMargin(90);
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD,4);
$bplot->SetCSIMTargets($targ1,$alts1);
//$graph->Stroke();

$graph->Stroke('./jpgraph_cache/periodgra.png');
$imgmap = $graph->GetHTMLImageMap('barmap');
echo $imgmap;
echo "<img src='http://www.fossilplot.org/test/graph/jpgraph_cache/periodgra.png' ISMAP USEMAP='#barmap' border='0'>";
?>
    
    
    